﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BLL;
using IFactory;


public partial class Admin_Admin_Login : System.Web.UI.Page
{
    IAuthentication dllAuthentication = new Authentication();
    protected void Page_Load(object sender, EventArgs e)
    {
        Utility.HttpHelp.redirectPage("~/Admin/RedirectLogin.htm");
    }


    /// <summary>
    /// 登陆按钮事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (this.txtUserName.Text == "system")
        {
            int result = dllAuthentication.UserLogin(this.txtUserName.Text.Trim(), this.txtPassWord.Text.Trim());
            if (result > 0)
            {
                Response.Redirect("Main.aspx");
            }
            else
            {
                Response.Redirect("Admin_Login.aspx");
            }
        }
        else
        {
            this.txtUserName.Text = "";
            Utility.HttpHelp.alert("该帐号不允许登录", Page);
        }
    }
}
